<?php

namespace common\models\credit_old_app_tables;

use Yii;

/**
 * This is the model class for table "{{%payments_detail}}".
 *
 * @property int $pd_id ID
 * @property string $pd_number 订单号
 * @property int $pd_date 入账日期
 * @property string $pd_items 费用项目
 * @property string $pd_type 收入/支出
 * @property string $pd_money 金额
 * @property string $pd_pay_type 打款方式
 * @property string $pd_bank 收款银行
 * @property string $pd_account 收款账号
 * @property string $pd_remark 备注
 * @property int $pd_time 录入日期
 * @property int $pd_uid 录入人ID
 * @property string $pd_user 录入人
 * @property string $pd_status 状态
 * @property int $pd_fcustid 原表ID
 * @property string $pd_upno
 */
class SlPaymentsDetail extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%payments_detail}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_old_app');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['pd_date', 'pd_time', 'pd_uid', 'pd_fcustid'], 'integer'],
            [['pd_type', 'pd_status'], 'string'],
            [['pd_money'], 'number'],
            [['pd_number'], 'string', 'max' => 15],
            [['pd_items'], 'string', 'max' => 10],
            [['pd_pay_type', 'pd_account', 'pd_user', 'pd_upno'], 'string', 'max' => 50],
            [['pd_bank'], 'string', 'max' => 100],
            [['pd_remark'], 'string', 'max' => 200],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'pd_id' => Yii::t('app', 'ID'),
            'pd_number' => Yii::t('app', '订单号'),
            'pd_date' => Yii::t('app', '入账日期'),
            'pd_items' => Yii::t('app', '费用项目'),
            'pd_type' => Yii::t('app', '收入/支出'),
            'pd_money' => Yii::t('app', '金额'),
            'pd_pay_type' => Yii::t('app', '打款方式'),
            'pd_bank' => Yii::t('app', '收款银行'),
            'pd_account' => Yii::t('app', '收款账号'),
            'pd_remark' => Yii::t('app', '备注'),
            'pd_time' => Yii::t('app', '录入日期'),
            'pd_uid' => Yii::t('app', '录入人ID'),
            'pd_user' => Yii::t('app', '录入人'),
            'pd_status' => Yii::t('app', '状态'),
            'pd_fcustid' => Yii::t('app', '原表ID'),
            'pd_upno' => Yii::t('app', 'Pd Upno'),
        ];
    }
}
